<?php
include_once "mdbtable.php";

class MSchetFix extends MDbTable {

	public $table = "schet_fix";

	public function getLast($schet_id, $last_fix_id = null)
	{
		$filters = array('schet_id' => $schet_id, 'sort' => 'date desc');
		if($last_fix_id)
		{
			$filters['id<>'] = $last_fix_id;
		}
		return $this->getFirstRow($filters);
	}

	public function insert($arr, &$id)
	{
		$arr['time_add'] = time();
		parent::insert($arr, $id);
	}


}

